package com.project.logistics.mapper;

import com.project.logistics.bean.Evaluate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
@Mapper
public interface ApplicantMapper {
//修改密码
    @Update("update user set password= #{newPassword} where user_id = #{userId}")
    void updatePassword(@Param("newPassword") String newPassword,@Param("userId") String userId);
//获得当前用户评价
    @Select("select e.repairs_id,evaluate_time,evaluate_score,evaluate_comment from evaluate e LEFT JOIN repairs r ON e.repairs_id=r.repairs_id where repairs_user_id=#{userId}")
    List<Evaluate> getComments(String userId);

    //获得当前用户当前报修评论
    @Select("select * from evaluate where repairs_id=#{repairsId}")
    Evaluate getCommentById(String repairsId) ;

    //
}
